<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui">

	<p:dialog header="Detail de la hotesse"
		widgetVar="detailHotesseDialog" resizable="false" width="770"
		showEffect="clip" hideEffect="clip">
		
		<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
		
		<h:panelGrid id="detail" columns="3" cellpadding="1">
			<h:panelGrid columns="2" cellpadding="1" width="250">
				<h:outputText value="Nom" />
				<h:outputText style="font-weight:bold" value="#{hotesse.nom}" />

				<h:outputText value="Prenom" />
				<h:outputText style="font-weight:bold" value="#{hotesse.prenom}" />

				
				<h:outputText value="Adresse" />
				<h:outputText style="font-weight:bold" value="#{hotesse.adresse.nomDeRue}" />

				<h:outputText value="Ville" />
				<h:outputText style="font-weight:bold" value="#{hotesse.adresse.codePostal} #{hotesse.adresse.ville}" />
							
				<h:outputText value="Email" />
				<h:outputText style="font-weight:bold" value="#{hotesse.adresse.email}" />
			
				<h:outputText value="Telephone domicile" />
				<h:outputText style="font-weight:bold" value="#{hotesse.adresse.telDomicile}" />

				<h:outputText value="Telephone portable" />
				<h:outputText style="font-weight:bold" value="#{hotesse.adresse.telPortable}" />

				<h:outputText value="Date de naissance" />
				<h:outputText style="font-weight:bold" value="#{hotesse.dateDeNaissance}">
					<f:convertDateTime timeZone="GMT+3" pattern="dd/MM/yyyy" />
				</h:outputText>
				
				<h:outputText value="Derniere visite" />
				<h:outputText style="font-weight:bold" value="#{hotesse.derniereVisite}">
					<f:convertDateTime timeZone="GMT+3" pattern="dd/MM/yyyy" />
				</h:outputText>
				
			</h:panelGrid>
				
			<h:panelGrid columns="2" cellpadding="1" width="250">
				
				<h:outputText value="Taille haut" />
				<h:outputText style="font-weight:bold" value="#{hotesse.tailleHaut.nom}" />
				
				<h:outputText value="Taille bas" />
				<h:outputText style="font-weight:bold" value="#{hotesse.tailleBas.nom}" />
								
				<h:outputText value="Preferences" />
				<p:scrollPanel style="width:140px;height:62px">
					<h:outputText value="#{hotesse.preferences}" />
				</p:scrollPanel>
				
				<h:outputText value="Commentaires" />
				<p:scrollPanel style="width:140px;height:62px">
					<h:outputText value="#{hotesse.commentaires}" />
				</p:scrollPanel>
				
			</h:panelGrid>
			
			<h:panelGrid columns="2" cellpadding="1" width="250">
				<h:outputText value="Achats" />
				<p:scrollPanel style="width:140px;height:60px">
					<h:outputText value="#{hotesse.achats}" />
				</p:scrollPanel>
				
				<h:outputText value="Produits" />
				<p:scrollPanel style="width:140px;height:110px">
					<h:outputText value="#{fn:length(hotesse.produits)} produit(s)" />
				</p:scrollPanel>
			</h:panelGrid>
			
		</h:panelGrid>
		
		<p:panel style="text-align:center">
			<h:commandButton action="#{backBean.modifierHotesse}" value="Modifier"/>
			<h:commandButton id="showDialogButton" value="Supprimer" onclick="confirmation.show()" type="button" />
		</p:panel>
		
	</p:dialog>
	
	<p:confirmDialog id="confirmDialog" appendToBody="true" message="Voulez vous supprimez cette hotesse ?" header="Suppression" severity="alert" widgetVar="confirmation">  
        <p:commandButton id="confirm" value="Oui" oncomplete="confirmation.hide()" action="#{backBean.supprimerHotesse}" />  
        <p:commandButton id="decline" value="Non" onclick="confirmation.hide()" type="button" />   
    </p:confirmDialog>
</ui:composition>